//
//  KLWebSocket.h
//  WebRTCDemo_iOS
//
//  Created by szblsx2 on 2020/3/5.
//  Copyright © 2020 szblsx2. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface KLWebSocket : NSObject
//接收到服务器信息回调
@property (nonatomic, copy) void (^onDataRecvice)(NSString *message);
//socket连接状态回调
@property (nonatomic, copy) void (^socketConnect)(BOOL success);

/**
*  连接socket
*  @param urlString 信令服务器地址
*/
- (void)connectWebSocketWithUrlString:(NSString *)urlString;

/**
*  断开连接
*/
- (void)closeWebSocket;

/**
*  向服务器发送信令
*  @param jsonData 信令JSON
*/
- (void)sendData:(NSString *)jsonData;

@end

NS_ASSUME_NONNULL_END
